/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.iftk.xmlparser.domain;

import org.jsoup.Jsoup;

/**
 *
 * @author treiman
 */
public class PriceList extends BubbleItem {
    private String maukkaasti;
    private String edullisesti;
    private String kevyesti;
    private String key;
    
    public PriceList() {
        setBubbleTitle("Price Categories");
        key = "\n* Price with Lyyra-card\nBuffé 8,60 €, includes a cup of coffee. Children 4,60 €  (0-7 years old)";
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getEdullisesti() {
        return edullisesti;
    }

    public void setEdullisesti(String edullisesti) {
        this.edullisesti = Jsoup.parse(edullisesti).text();
    }

    public String getKevyesti() {
        return kevyesti;
    }

    public void setKevyesti(String kevyesti) {
        this.kevyesti = Jsoup.parse(kevyesti).text();
    }

    public String getMaukkaasti() {
        return maukkaasti;
    }

    public void setMaukkaasti(String maukkaasti) {
        this.maukkaasti = Jsoup.parse(maukkaasti).text();
    }
    
    @Override
    public String toBubble() {
        StringBuilder result = new StringBuilder();
        String NEW_LINE = System.getProperty("line.separator");
        
        result.append("Maukkaasti:").append(NEW_LINE).append(maukkaasti).
                append(NEW_LINE).append("\nEdullisesti:").append(NEW_LINE).
                append(edullisesti).append(NEW_LINE).append("\nKevyesti:").
                append(NEW_LINE).append(kevyesti).append(NEW_LINE).append(key);
        
        setBubbleShort(result.toString());
        
        result = new StringBuilder();
        
        result.append("<bubble>").append(NEW_LINE);
        result.append("\t<id>").append(getId()).append("</id>").append(NEW_LINE);
        result.append("\t<titletext>").append(getBubbleTitle()).append("</titletext>").append(NEW_LINE);
        result.append("\t<titlefontsize>10</titlefontsize>").append(NEW_LINE);
        result.append("\t<shorttext fontsize=\"3\"><![CDATA[").append(getBubbleShort()).append("]]></shorttext>").append(NEW_LINE);
        result.append("\t<style>PinkLevel3</style>").append(NEW_LINE);
        result.append("\t<priority>3</priority>").append(NEW_LINE);
        result.append("\t<links></links>").append(NEW_LINE);
        result.append("</bubble>").append(NEW_LINE);
        
        return result.toString();
    }
}
